

<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Overview &mdash; O365  documentation</title>
      <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
      <link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />

  
      <script src="_static/jquery.js?v=5d32c60e"></script>
      <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
      <script src="_static/documentation_options.js?v=5929fcd5"></script>
      <script src="_static/doctools.js?v=9bcbadda"></script>
      <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="_static/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Getting Started" href="getting_started.html" />
    <link rel="prev" title="Welcome to O365’s documentation!" href="index.html" />
    <link href="_static/css/style.css" rel="stylesheet" type="text/css">

</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="index.html">
            
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#core-developers">Core developers</a></li>
<li class="toctree-l2"><a class="reference internal" href="#quick-example">Quick example</a></li>
<li class="toctree-l2"><a class="reference internal" href="#why-choose-o365">Why choose O365?</a></li>
<li class="toctree-l2"><a class="reference internal" href="#rebuilding-html-docs">Rebuilding HTML Docs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Detailed Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">O365 API</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">O365</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">Overview</li>
      <li class="wy-breadcrumbs-aside">
            <a href="_sources/overview.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul><div class="rst-breadcrumbs-buttons" role="navigation" aria-label="Sequential page navigation">
        <a href="index.html" class="btn btn-neutral float-left" title="Welcome to O365’s documentation!" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="getting_started.html" class="btn btn-neutral float-right" title="Getting Started" accesskey="n">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
  </div>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="overview">
<h1>Overview<a class="headerlink" href="#overview" title="Link to this heading"></a></h1>
<p><strong>O365 - Microsoft Graph API made easy</strong></p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>With version 2.1 old access tokens will not work, and the library will require a new authentication flow to get new access and refresh tokens.</p>
</div>
<p>This project aims to make interacting with Microsoft Graph easy to do in a Pythonic way. Access to Email, Calendar, Contacts, OneDrive, etc. Are easy to do in a way that feel easy and straight forward to beginners and feels just right to seasoned python programmer.</p>
<p>The project is currently developed and maintained by <a class="reference external" href="https://github.com/alejcas/">alejcas</a>.</p>
<section id="core-developers">
<h2>Core developers<a class="headerlink" href="#core-developers" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/alejcas/">Alejcas</a></p></li>
<li><p><a class="reference external" href="https://github.com/Narcolapser/">Toben Archer</a></p></li>
<li><p><a class="reference external" href="https://github.com/GeethanadhP/">Geethanadh</a></p></li>
</ul>
<p>We are always open to new pull requests!</p>
</section>
<section id="quick-example">
<h2>Quick example<a class="headerlink" href="#quick-example" title="Link to this heading"></a></h2>
<p>Here is a simple example showing how to send an email using python-o365.
Create a Python file and add the following code:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">O365</span><span class="w"> </span><span class="kn">import</span> <span class="n">Account</span>

<span class="n">credentials</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;client_id&#39;</span><span class="p">,</span> <span class="s1">&#39;client_secret&#39;</span><span class="p">)</span>
<span class="n">account</span> <span class="o">=</span> <span class="n">Account</span><span class="p">(</span><span class="n">credentials</span><span class="p">)</span>

<span class="n">m</span> <span class="o">=</span> <span class="n">account</span><span class="o">.</span><span class="n">new_message</span><span class="p">()</span>
<span class="n">m</span><span class="o">.</span><span class="n">to</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="s1">&#39;to_example@example.com&#39;</span><span class="p">)</span>
<span class="n">m</span><span class="o">.</span><span class="n">subject</span> <span class="o">=</span> <span class="s1">&#39;Testing!&#39;</span>
<span class="n">m</span><span class="o">.</span><span class="n">body</span> <span class="o">=</span> <span class="s2">&quot;George Best quote: I&#39;ve stopped drinking, but only while I&#39;m asleep.&quot;</span>
<span class="n">m</span><span class="o">.</span><span class="n">send</span><span class="p">()</span>
</pre></div>
</div>
</section>
<section id="why-choose-o365">
<h2>Why choose O365?<a class="headerlink" href="#why-choose-o365" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p>Almost Full Support for MsGraph Rest Api.</p></li>
<li><p>Full OAuth support with automatic handling of refresh tokens.</p></li>
<li><p>Automatic handling between local datetimes and server datetimes. Work with your local datetime and let this library do the rest.</p></li>
<li><p>Change between different resource with ease: access shared mailboxes, other users resources, SharePoint resources, etc.</p></li>
<li><p>Pagination support through a custom iterator that handles future requests automatically. Request Infinite items!</p></li>
<li><p>A query helper to help you build custom OData queries (filter, order, select and search).</p></li>
<li><p>Modular ApiComponents can be created and built to achieve further functionality.</p></li>
</ul>
<hr class="docutils" />
<p>This project was also a learning resource for us. This is a list of not so common python idioms used in this project:</p>
<ul class="simple">
<li><p>New unpacking technics: <code class="docutils literal notranslate"><span class="pre">def</span> <span class="pre">method(argument,</span> <span class="pre">*,</span> <span class="pre">with_name=None,</span> <span class="pre">**other_params)</span></code>:</p></li>
<li><p>Enums: from enum import Enum</p></li>
<li><p>Factory paradigm</p></li>
<li><p>Package organization</p></li>
<li><p>Timezone conversion and timezone aware datetimes</p></li>
<li><p>Etc. (see the code!)</p></li>
</ul>
</section>
<section id="rebuilding-html-docs">
<h2>Rebuilding HTML Docs<a class="headerlink" href="#rebuilding-html-docs" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p>Install <code class="docutils literal notranslate"><span class="pre">sphinx</span></code> python library:</p></li>
</ul>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">pip install sphinx</span>
</pre></div>
</div>
<ul class="simple">
<li><p>Run the shell script <code class="docutils literal notranslate"><span class="pre">build_docs.sh</span></code>, or copy the command from the file when using on Windows</p></li>
</ul>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="index.html" class="btn btn-neutral float-left" title="Welcome to O365’s documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="getting_started.html" class="btn btn-neutral float-right" title="Getting Started" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2025, alejcas.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>